import { HttpClient, HttpServer, WsClient } from "tsrpc";
import { ecs } from "../../../core/ecs/ECS";
import { Room } from "../../../module/room/Room";
import { serviceProto as ServiceProtoRoom, ServiceType as ServiceTypeRoom } from "../../../tsrpc/shared/protocols/RoomServiceProto";

/** 房间服务器数据 */
// export interface IRoomServer {
//     /** 房间服务器连接地址 */
//     url: string,
//     /** 房间服务器连接对象 */
//     //client: WsClient<ServiceTypeRoom>,
//     /** 房间状态数据 */
//     //state?: MsgRoomUpdateState
    
//     state?:any
// }

/** 网关服务器数据 */
@ecs.register('HallModel')
export class HallModel extends ecs.Comp {
    /** 服务管理器 */
    hsHall: HttpServer = null!;
    hsRoom: WsClient<ServiceTypeRoom> = null!;
    rooms:Map<number, Room> = new Map();
    /** 匹配服务器 Http 连接对象 */
    //hcMatch = new Map<string, HttpClient<ServiceTypeMatch>>();
    /** 已注册的房间服务器 */
    // readonly rooms: IRoomServer[] = [];

    /** 待匹配队列 */
    //readonly queue = new Set<ApiCallHttp<ReqMatchStart, ResMatchStart>>();

    reset(): void {
        
    }
}